
var options;
$(function() {
	$.fn.manhuaTip = function(options) {
		var defaults = {
			Event : "click",
			timeOut : 2000
		};
		options = $.extend(defaults,options);
		//var $tip = $(this);
		/*$tip.live(options.Event,function(e){	
			var type = $(this).attr('ty');		
			var msg = $(this).attr('msg');
		  	var tipHtml = '';
			if (type =='loading'){
				tipHtml = '<img alt="" src="/images/loading.gif">'+(msg ? msg : '正在提交您的请求，请稍候...');
			} else if (type =='notice'){
				tipHtml = '<span class="gtl_ico_hits"></span>'+msg
			} else if (type =='error'){
				tipHtml = '<span class="gtl_ico_fail"></span>'+msg
			} else if (type =='succ'){
				tipHtml = '<span class="gtl_ico_succ"></span>'+msg
			}
			if ($('.msgbox_layer_wrap')) {
				$('.msgbox_layer_wrap').remove();
			}
			if (st){
				clearTimeout(st);
			}
			$("body").prepend("<div class='msgbox_layer_wrap'><span id='mode_tips_v2' style='z-index: 10000;' class='msgbox_layer'><span class='gtl_ico_clear'></span>"+tipHtml+"<span class='gtl_end'></span></span></div>");
			$(".msgbox_layer_wrap").show();
			var st = setTimeout(function (){
				$(".msgbox_layer_wrap").hide();
				clearTimeout(st);
			},options.timeOut);
		});	*/
	}
});

var showTip = function(){
	var type = "loading";//$(this).attr('ty');		
	var msg = $(this).attr('msg');
  	var tipHtml = '';
	if (type =='loading'){
		tipHtml = '<img alt="" src="/images/loading.gif">'+(msg ? msg : i18n.submiting);
	} else if (type =='notice'){
		tipHtml = '<span class="gtl_ico_hits"></span>'+msg
	} else if (type =='error'){
		tipHtml = '<span class="gtl_ico_fail"></span>'+msg
	} else if (type =='succ'){
		tipHtml = '<span class="gtl_ico_succ"></span>'+msg
	}
	if ($('.msgbox_layer_wrap')) {
		$('.msgbox_layer_wrap').remove();
	}
	if (st){
		clearTimeout(st);
	}
	$("body").prepend("<div class='msgbox_layer_wrap'><span id='mode_tips_v2' style='z-index: 10000;' class='msgbox_layer'><span class='gtl_ico_clear'></span>"+tipHtml+"<span class='gtl_end'></span></span></div>");
	$(".msgbox_layer_wrap").show();
	var st = setTimeout(function (){
		$(".msgbox_layer_wrap").hide();
		clearTimeout(st);
	},60000);
}

var showTipWithMsg = function(msg){
	var type = "loading";//$(this).attr('ty');		
  	var tipHtml = '';
	if (type =='loading'){
		tipHtml = '<img alt="" src="/images/loading.gif">'+(msg==null ? i18n.submiting : msg);
	} else if (type =='notice'){
		tipHtml = '<span class="gtl_ico_hits"></span>'+msg
	} else if (type =='error'){
		tipHtml = '<span class="gtl_ico_fail"></span>'+msg
	} else if (type =='succ'){
		tipHtml = '<span class="gtl_ico_succ"></span>'+msg
	}
	if ($('.msgbox_layer_wrap')) {
		$('.msgbox_layer_wrap').remove();
	}
	$("body").prepend("<div class='msgbox_layer_wrap'><span id='mode_tips_v2' style='z-index: 10000;white-space:nowrap;' class='msgbox_layer'><span class='gtl_ico_clear'></span>"+tipHtml+"<span class='gtl_end'></span></span></div>");
	$(".msgbox_layer_wrap").show();
}


var closeTip = function(){
	$(".msgbox_layer_wrap").remove();
}

